import { PureComponent } from 'react';
import Draggable, { DraggableCore } from 'react-draggable';

export default class DraggableBox extends PureComponent {


    handleStart = (e) => {
        console.log(e);
    };

    handleDrag = (e) => {
        console.log(e);
    };

    handleStop = (e) => {
        console.log(e);
    };

    render() {
        return (
            <Draggable
                axis="y"
                handle=".handle"
                defaultPosition={{ x: 0, y: 0 }}
                position={null}
                grid={[25, 25]}
                onStart={this.handleStart}
                onDrag={this.handleDrag}
                onStop={this.handleStop}
                className={this.props.className}
            >
                {this.props.children}
            </Draggable>
        );
    }
}
